vcComponent
Object type for a component and its associated root node.
See in: Overview
Module: vcCore
Parent: vcNode
Children -
Referenced by: vcAuthorContext.ActiveComponent, vcBehavior.Component, vcComponentCreator.TemplateComponent, vcComponentCreator.create(), ... (see more)
vcAuthorContext.ActiveComponent
vcBehavior.Component
vcComponentCreator.TemplateComponent
vcComponentCreator.create()
vcComponentSignal.Value
vcContainer.Components
vcCore.getComponent()
vcGetPropertyStatement.SelectedComponent
vcNode.Component
vcNode.getChildComponents()
vcOneToManyInterface.ConnectedComponents
vcProduct.Component
vcProductFilter.Component
vcPropertyConditionStatement.SelectedComponent
vcRunRobotRoutineStatement.RobotComponent
vcSendSignalStatement.SelectedComponent
vcSimInterface.ConnectedComponent
vcWaitSignalStatement.Component
vcWorld.Components
vcWorld.createComponent()
vcWorld.findComponent()
Properties
Learn how to use properties here. The properties are also inherited from the parent class.
| Name | Type | Access | Description |
| BOM | Boolean | RW | Gets or sets a value which defines whether component is included in the bill of materials. |
| BOMdescription | String | RW | Gets or sets the component's description in the bill of materials. |
| BOMname | String | RW | Gets or sets the component's name in the bill of materials. |
| BackfaceMode | vcBackfaceMode | RW | Gets or sets the mode for rendering geometry backfaces of component. That is, geometry not facing active camera. |
| Category | String | RW | Gets or sets the component group in Cell Graph. |
| Container | vcFlow | R | Gets the container which is storing the component. |
| CreationTime | Real | RW | Gets or sets the component's creation time. |
| IsDynamic | Boolean | R | Gets the value indicating whether the component has been created during simulation |
| IsUnique | Boolean | R | Gets the value indicating whether the component is sharing its feature trees with other components. |
| Joints | list[vcLinkJoint] | R | Gets all link joints within this component, regardless of which link they are associated with. |
| Locked | Boolean | RW | Gets or sets a value which defines if the component is locked from being edited or manipulated in 3D world. |
| Material | vcMaterial | RW | Gets or sets the material of the component See moreand any of its features which do not have an assigned material or whose node is set to inherit a material. |
| MovementOrigin | vcMatrix | RW | Gets or sets the component's offset when moving on a path. |
| Name | String | RW | Gets or sets component name. Exceptions: ValueError: When given component name is empty or not unique. |
| PDFExportLevel | vcPdfExportLevel | RW | Gets or sets the level of detail when exporting the component to a 3D PDF. |
| PackFolder | vcPackFolder | R | Gets the mechanism for attaching files to the component. |
| PathAcceleration | Real | RW | Gets or sets the acceleration of the component when moving on a path |
| PathDeceleration | Real | RW | Gets or sets the deceleration of the component when moving on a path. |
| PathVelocity | Real | RW | Gets or sets the velocity of the component when moving on and in the direction of a path. |
| Product | vcProduct | R | Gets the Process Modeling product instance linked to this component, if any. |
| Properties | vcPropertyContainer | R | Gets the properties of this component. |
| SimulationLevel | vcSimulationLevel | RW | Gets or sets the simulation level of the component. |
| Uri | String | R | Gets the component's URI. |
| VCID | String | R | Gets the VCID of component. That is, the unique key identifier of the component. |
| Visible | Boolean | RW | Gets or sets the visibility of the component in 3D world. |
Methods
Learn how to use methods here. The methods are also inherited from the parent class.
| Name | Return Type | Parameters | Description |
| clone | vcComponent | Optional Keyword[shared = Boolean] | Creates a clone of the component.See moreParameters: shared (Boolean): If True, the feature tree is shared between the original and cloned component. This improves performance during simulation, but the cloned components cannot be edited separately (changing the appearance of either the clone or original component affects the other). Exceptions: RuntimeError: When cloning of a component is not allowed. This can occur if 1) the component is not attached to World. 2) there is a hierarchy lock in the node tree, which happens during layout loading, or if the component is being moved from one place to another in the node tree. 3) attempting to call the method from the main level of the script. Returns: vcComponent: Newly created clone of the component. |
| createLink | vcLinkNode | String name | Creates a new child link node with the given name.See moreParameters: name (String): The name for the newly created link node. Exceptions: RuntimeError: When the node hierarchy is locked. Returns: vcLinkNode: Newly created link node object. |
| getPathDistance | Real | None | Gets the distance of component on a path. If the component is not on a path, returns negative value. Returns: Real: Component's distance on a path. |
| incrementRevision | None | None | Increments the revision number of a file when using save() method.See moreThe effect is the same as the Increment Revision property in the Credits dialog when saving a file. |
| makeUnique | None | None | Makes the component's feature tree unique, thereby it's not shared with other components. |
| save | None | String uri | Saves the component to the given file. Parameters: uri (String): File path where the component is saved to. |
| saveState | None | None | Saves the current state of the component as its initial state. |
| startMovement | None | None | Start the movement of component in a flow, for example a path. Exceptions: RuntimeError: When component is not stored in a container. |
| stopMovement | None | None | Stops the movement of component in a flow, for example a path. Exceptions: RuntimeError: When component is not stored in a container. |
| transfer | None | vcConnector connector | Transfers component into a flow and blocks Python execution until completion of transfer.See moreParameters: connector (vcConnector): Connector for performing the transfer. Exceptions: RuntimeError: When the call cannot consume simulation time. |
| transfer | None | vcFlow flow, Optional Keyword[port = Integer] | Transfers component into a flow and blocks Python execution until completion of transfer.See moreParameters: flow (vcFlow): The flow behavior to get the connector from. port (Integer): The port in the flow behavior to get the connector from. Exceptions: ValueError: When there is no valid connector at the given port. RuntimeError: When the call cannot consume simulation time. |
| transferNonBlocking | None | vcConnector connector | Transfers component into a flow without blocking Python execution (does not wait for completion of transfer).See moreParameters: connector (vcConnector): Connector for performing the transfer. Exceptions: RuntimeError: When the call cannot consume simulation time. |
| transferNonBlocking | None | vcFlow flow, Optional Keyword[port = Integer] | Transfers component into a flow without blocking Python execution (does not wait for completion of transfer).See moreParameters: flow (vcFlow): The flow behavior to get the connector from. port (Integer): The port in the flow behavior to get the connector from. Exceptions: ValueError: When there is no valid connector at the given port. RuntimeError: When the call cannot consume simulation time. |
Events
Learn how to use events here. The events are also inherited from the parent class.
| Name | Parameters | Description |
| OnContainerTransition | vcContainer container, Boolean arrived | Triggered when component enters or exits a container object.See moreParameters: container (vcContainer): Container through which the component transitions. arrived (Boolean): True - component is entering the container. False - component is exiting the container. |
| OnNodeConfigurationChange | vcNodeSynchronizationType type, vcNode node1, vcNode node2 | Triggered when a change occurs in component node hierarchy.See moreParameters: type (vcNodeSynchronizationType): type of change that occurred in component. node1 (vcNode): First node affected by the change. node2 (vcNode): Second node affected by the change. |
Example: Conveyor Stopping One Product
""" This example shows how to stop, delay and start a product movement on a conveyor when a signal is received. """ import vcCore as vc comp = vc.getComponent() sensor_signal = comp.findBehavior("SensorSignal") # can be triggered by the path sensor behavior component_signal = comp.findBehavior("ComponentSignal") # can be triggered by the path sensor behavior process_time = comp.Properties["ProcessTime"] async def OnRun(): while True: await sensor_signal.waitFor(True, waitTrigger=True) product = component_signal.Value product.stopMovement() # this stops the product movement on the conveyor await vc.delay(process_time.Value) product.startMovement() # this starts the product movement on the conveyor
Example: Create New Behavior
""" This example shows how to create a new behavior. """ import vcCore as vc import vcBehaviors as vc_beh comp = vc.getComponent() sensor_signal = comp.createBehavior(vc_beh.vcBehaviorType.BOOLEAN_SIGNAL, "SensorSignal")